/*
 * Copyright © 2017-2018 Cask Data, Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
*/

@import '../../../styles/variables.scss';
$input-width: 120px;

.tags-holder {
  display: flex;
  align-items: center;

  > span {
    display: inline-block;
  }

  .tags-list {
    /* 120px width of input box + 10px padding + 50px width of All Tags label + 10px padding + 15px width of loading icon */
    max-width: calc(100% - #{$input-width} - 10px - 50px - 10px - 15px);
    overflow: hidden;
    white-space: nowrap;
    .tag-btn {
      &:first-child {
        margin-left: 0;
      }
    }
  }

  .btn {
    padding: 3px 5px;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 18px;

    &.plus-button-container {
      margin-left: 3px;
      height: 18px;
      background-color: $grey-04;
      border-radius: 4px;
      border-color: white;

      .icon-plus {
        font-size: 7px;
      }
    }
  }

  .tag-input {
    height: 20px;
    line-height: 20px;
    width: $input-width;
    display: inline-block;
    padding: 0 5px;
    margin-left: 5px;
    margin-right: 3px;
    vertical-align: middle;
    font-size: 12px;
  }

  .tags-popover {
    margin: 0 5px;

    .all-tags-label {
      color: $blue-03;
      cursor: pointer;
    }

    .popper {
      z-index: 1000;
      padding: 10px;
      text-align: left;
      width: inherit;
      max-height: 240px;
      overflow-y: auto;

      .tags-popover-header {
        display: flex;
        align-items: center;
        margin-bottom: 10px;

        .icon-close {
          font-size: 13px;
          margin-left: auto;
          cursor: pointer;
        }
      }

      .tag-btn {
        display: table;
        margin-left: 0;
      }
    }
  }
}
